package club.pchome.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import club.pchome.dto.UserInfoDto;
import club.pchome.mapper.UserInfoMapper;
import club.pchome.model.UserInfo;

@Service
public class UserInfoService {

	
	@Autowired
	UserInfoMapper userInfoMapper;
	
	/**
	 * 获取用户信息
	 * @param cookie
	 * @return
	 */
	public List<UserInfo> getCapitalList(){
		return userInfoMapper.getCapitalList();
	}
	
	/**
	 * 根据 autoSignId 获取用户信息
	 * @return
	 */
	public long getCapitalListById( long autoSignId ){
		return userInfoMapper.getCapitalListById( autoSignId );
	}
	
	/***
	 * 设置用户信息
	 * @param userInfo
	 * @return
	 */
	public long setCapitalList(UserInfoDto userInfo){
		return userInfoMapper.insert( userInfo );
	}
	
	/***
	 * 修改用户信息
	 * @param userInfo
	 * @return
	 */
	public long updateCapitalList(UserInfoDto userInfo){
		return userInfoMapper.updateCapitalList( userInfo );
	}

	/**
	 * 自动检测账户信息
	 * @return
	 */
	public List<UserInfoDto> autoCheckAccountInfo(){ return userInfoMapper.autoCheckAccountInfo(); }
}

